package com.example.oneservice.common;

import java.io.Serializable;
import java.util.Date;

/**
 * 请求响应对象
 * 
 * @author bin.zhang
 *
 */
public class ResponseDto implements Serializable {

	private static final long serialVersionUID = 182973046979026754L;


	private Long timestamp;

	private int code = 0;

	private String message;

	private Object data;
	
	public ResponseDto() {
		super();
		this.timestamp = new Date().getTime();
	}
	
	public ResponseDto(int code, String message) {
		super();
		this.timestamp = new Date().getTime();
		this.code = code;
		this.message = message;
	}

	public ResponseDto(Object data) {
		super();
		this.timestamp = new Date().getTime();
		this.data = data;
	}

	public ResponseDto(String message, Object data) {
		super();
		this.timestamp = new Date().getTime();
		this.message = message;
		this.data = data;
	}

	public ResponseDto(int code, String message, Object data) {
		super();
		this.timestamp = new Date().getTime();
		this.code = code;
		this.message = message;
		this.data = data;
	}

	public ResponseDto(int code, String message, Object data, long timestamp) {
		super();
		this.timestamp = timestamp;
		this.code = code;
		this.message = message;
		this.data = data;
	}

	public Long getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(Long timestamp) {
		this.timestamp = timestamp;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

}
